<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <title></title>
    <meta http-equiv="cache-control" content="no-cache">

    <link rel="stylesheet" type="text/css" href="/css/edittable.css"  ></link>
    <link rel="stylesheet" type="text/css" href="/css/validate.css"  ></link>
    <script type="text/javascript"  src="/js/jquery-1.8.0.js"></script>

</head>

<body>

<div class ="div_title">
    <div class="div_titlename"> <img src="/images/san_jiao.gif" ><span>权限分配</span></div>
</div>
    <form action="RoleServlet" method="post" onsubmit="return confirm('确认要赋予当前用户角色吗')" >
        <input type="hidden" name="flag" value="rolePower" >
        <input type="hidden" name="id" value="${admin.id}" >
        <table class="edit_table" >
            <tr>
                <td class="td_info">用户账号:</td>
                <td class="td_input_short">
                    <input type="text" class="txtbox" id="adminName" name="adminName" value="${admin.adminName }" readonly/>
                </td>
            </tr>
            <tr>
                <td class="td_info">用户角色:</td>
                <td class="td_input_short">
                    <c:forEach items="${roleList}" var="r">
                        <input type="radio" name="userRole" ${r.roleName == admin.roleName ? 'checked' : ''} value="${r.id}"> ${r.roleName} <br>
                    </c:forEach>
                </td>
            </tr>
            <tr>
                <td class="td_info"> </td>
                <td>
                    <input class="form_btn" type="submit" value="提交" />
                    <input type="reset"  class="form_btn" value="重置" /> </td>
                <td>
                    <label id="result_msg" class="result_msg">${msg}</label>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>